from ronglian_sms_sdk import SmsSDK
import random
import redis
from mdpro.celery import app
import json


accId = '8aaf0708827c8fd50182aa96207507f3'
accToken = 'cb04155a245c41adb8073f34b48657a1'
appId = '8aaf0708827c8fd50182aaa1681c084b'

@app.task
def send_message(mobile,msg_code):
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    # mobile = '13030335102'

    datas = (msg_code, '5')
    resp = sdk.sendMessage(tid, mobile, datas)
    json_resp = json.loads(resp)
    print('返回的数据',json_resp)

    return resp
